@import "ui";
:root {

}
//系统切换到深色
@media (prefers-color-scheme: dark) {
  :root {

  }
}
html{
  line-height: 1;
  font-size: 14px;
}
//滚动条样式
*::-webkit-scrollbar{width:5px!important;background:rgba(0,0,0,.05)!important;height:5px!important;border-radius:0!important;}
*::-webkit-scrollbar-thumb{background:rgba(0,0,0,.5)!important;border-radius:0!important;}
ul, dl{list-style-type: none;margin: 0;padding: 0;}
a{color: var(--color-dark);text-decoration: none;transition: .3s;}
a:hover{ color: var(--color-primary);text-decoration: none;}
//
.app-outlet{
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-flow: row;
  user-select: none;
  aside{
    overflow: hidden;
    display: flex;
    flex-flow: column;
    &:first-child{
      width: 92px;
      background: var(--color-dark);
      color: var(--color-dark-contrast);
    }
    .app-icon{
      height: calc(32px + var(--space-width) * 2);
      padding: var(--space-width);
      text-align: center;
      @extend .justify-center;
      font-size: var(--font-size-large);
    }
    menu{
      margin: 0;
      padding: 0;
      flex: 1;
      overflow: auto;
      .item{
        transition: 300ms;
        cursor: pointer;
        display: flex;
        flex-flow: row;
        height: var(--button-height);
        line-height: var(--button-height);
        margin: 0 var(--space-width-half) var(--space-width-half);
        padding: 0 var(--space-width);
        border-radius: var(--radius-width);
        .start{width: 1.8em;@extend .justify-center;}
        .center{
          @extend .justify-center;
          @extend .max-one-line-text;
        }
        &.active, &:hover{
          background: var(--color-dark-light);
        }
        &:active{
          background: #637181;
        }
      }
    }
    //拓展菜单
    &.extend-module {
      width: 130px;
      background: var(--color-light);
      border-right: solid 1px var(--border-color);
      .module-name {
        height: calc(32px + var(--space-width) * 2);
        display: flex;
        flex-flow: column;
        justify-content: center;
        text-align: center;
        font-weight: bold;
        border-bottom: solid 1px var(--border-color-light);
      }
      menu{
        padding-top: var(--space-width-half);
        dl{
          margin: 0 var(--space-width-half);
          transition: .3s;
          font-weight: normal;
          &:hover{
            background: #f9f9f9;
            border-radius: var(--radius-width);
          }
          dt {
            .item-hd {
              font-size: 12px;
              display: flex;
              flex-flow: row;
              padding: var(--space-width);
              cursor: pointer;
              transition: .3s;
              border-radius: var(--radius-width);
              color: var(--color-medium);
              &:hover{
                background: #ddd;
              }
              &:active{
                background: #eee;
              }
              .start{
                width: 1.8em;
                display: flex;
                flex-flow: column;
                justify-content: center;
              }
              .center{flex: 1;}
              .end{
                transition: .3s;
                display: flex;
                flex-flow: column;
                justify-content: center;
              }
            }
          }
          dd .item, dt .item{margin: 0 0 var(--space-width-half) 0; font-weight: normal;}
          dd{
            height: 0; overflow: hidden; transition: .3s;
            .item:first-child {margin-top: var(--space-width-half);}
            .item:last-child {margin-bottom: 0;}
          }
          &.open dt .item-hd .end{ transform: rotate(90deg); }
          &.open dd{ height: fit-content; }
          .item{
            &:hover, &.active{ background: #ddd; }
            &:active {
              background: #eee;
            }
          }
        }
      }
    }
  }
  .app-container{
    flex: 1;
    display: flex!important;
    flex-flow: column;
    overflow: hidden;
    header{
      height: calc(32px + var(--space-width) * 2);
      &.auto-height {
        height: auto;
      }
    }
    main{
      flex: 1;
      overflow-x: hidden;
      overflow-y: auto;
      .empty-content{
        flex: 1;
        border: solid 1px var(--border-color);
        border-radius: var(--radius-width);
        display: flex;
        flex-flow: column;
        justify-content: center;
        @extend .line45deg-background;
      }
    }
  }
}
/* 重写ANT DESIGN的一些组件样式 */
//modal对话框的关闭按钮
.ant-modal{
  .ant-modal-content{
    padding: 20px;
    .ant-modal-header{
      padding-bottom: 15px;
    }
    .ant-modal-header .ant-modal-title{
      &:before{content: "\f05a";font-family: var(--fa-style-family,"Font Awesome 6 Free");margin-right: var(--space-width);font-weight: 700;}
    }
    //关闭按钮
    .ant-modal-close{
      height: 32px;
      width: 32px;
      top: var(--space-width);
      right: var(--space-width);
      overflow: hidden;
      border-radius: 50%;
      background: #eee;
      transition: 300ms;
      .ant-modal-close-x{
        height: 32px;
        width: 32px;
        line-height: 32px;
        span{display: none!important;}
        &::after{
          content: "\f00d";
          font-family: var(--fa-style-family, "Font Awesome 6 Free") !important;
        }
      }
      &:hover{
        background: var(--color-danger);
        color: var(--color-danger-contrast);
      }
    }
  }
  //嵌套iframe
  &.iframe-body{
    width: 800px!important;
    .ant-modal-content{
      .ant-modal-body{padding: 0!important; height: 650px;}
    }
  }
}
//弹出框
.ant-drawer{
  .ant-drawer-content{
    .ant-drawer-close{
      height: 32px;
      width: 32px;
      line-height: 32px;
      border-radius: 50%;
      transition: 300ms;
      background: #eee;
      span{display: none!important;}
      &::after{
        content: "\f00d";
        font-family: var(--fa-style-family, "Font Awesome 6 Free") !important;
      }
      &:hover{
        background: var(--color-danger);
        color: var(--color-danger-contrast);
      }
    }
  }
}
//tag
.ant-tag.button{
  cursor: pointer;
}
.ant-tag.button:hover{
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.ant-tag.button.dashed{
  border-style: dashed;
}
//ant图片预览 防选择
.ant-image-preview-root{
  user-select: none!important;
}
//头像，特别色
.ant-avatar{
  &[class*='icon-plugin']{background: none;border: solid 1px var(--border-color);}
  &.icon-plugin-wechat{ color: #00c250; }
  &.icon-plugin-qq{ color: #0e90de; }
  &.icon-plugin-weibo{ color: #ff9a00; }
  &.icon-plugin-github{ color: #000000; }
  //上传
  &.upload{
    background: transparent;
    border: dashed 1px var(--color-medium);
    position: relative;
    transition: 300ms;
    color: var(--color-medium);
    cursor: pointer;
    &::after{
      content: "+";
      display: flex;
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      justify-content: center;
      text-align: center;
      z-index: -1;
    }
    &:hover{
      border-color: var(--color-primary);
      color: var(--color-primary);
    }
    &:active{
      border-color: var(--color-primary-light);
      color: var(--color-primary-light);
    }
  }
}
//表格(不启用滚动)
.ant-table {
  border: solid 1px var(--border-color);
  border-radius: var(--radius-width)!important;
  table {
    border-radius: var(--radius-width)!important;
    thead th:first-child{
      border-start-start-radius: var(--radius-width)!important;
    }
    thead th:last-child{
      border-start-end-radius: var(--radius-width)!important;
    }
    tbody{
      tr td{ border-top: solid 1px var(--border-color-light) !important;}
      tr.ant-table-row-selected td{ border-top-color: rgba(255,255,255,.6) !important;}
      tr:first-child{
        td{border-top: none!important;}
      }
      tr:last-child{
        td{border-bottom: solid 1px var(--border-color-light);}
        //td:first-child{border-end-start-radius: var(--radius-width)!important;}
        //td:last-child{border-end-end-radius: var(--radius-width)!important;}
      }
    }
  }
  .ant-table-container{
    border-radius: var(--radius-width)!important;
  }
  .ant-table-tbody { background-color: var(--light-background);}
  .ant-table-cell{ padding: var(--space-width)!important;
    &::before{
      background-color: var(--border-color) !important;
    }
  }
  //分页
  ~ .ant-pagination {
    margin: var(--space-width) 0 0 0!important;
  }
  tr th{ background-color: var(--hover-background) !important;}
}
//表格，启动滚动
.ant-table-wrapper.scroll-enable {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-flow: column;
  .ant-table-header {
    border-radius: var(--radius-width) var(--radius-width) 0 0!important;
  }
  .ant-spin-nested-loading, .ant-spin-container, .ant-table, .ant-table-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-flow: column;
  }
  .ant-table-body{overflow: auto!important;}
  .ant-table-container{
    .ant-table-body{
      flex: 1;
      border-end-start-radius: var(--radius-width);
      border-end-end-radius: var(--radius-width);
    }
  }
}
//
.ant-notification-notice-close:hover {
  background: var(--color-danger)!important;
  color: var(--color-danger-contrast)!important;
  text-decoration: none;
}
.ant-notification-notice-close .ant-notification-close-x{display: none!important;}
.ant-notification-notice-close::after {
  content: "\f00d";
  font-family: var(--fa-style-family, "Font Awesome 6 Free") !important;
}
//antd 复选框列表
.ant-checkbox-list{
  .ant-checkbox-wrapper{margin: var(--space-width-half)!important;}
}
//兼容初始化
a-config-provider{width: 100%;}